<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateOrdersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('orders', function (Blueprint $table) {
            $table->increments('id')->comment('订单id');
            $table->string('order_sn')->default('')->comment('订单号');
            $table->integer('user_id')->nullable(false)->comment('用户id');
            $table->tinyInteger('order_status')->default(0)->comment('订单状态');
            $table->tinyInteger('pay_status')->default(0)->comment('支付状态');
            $table->decimal('total_amount', 10, 2)->comment('订单金额');
            $table->string('name')->default('')->comment('被祈福人名称');
            $table->string('user_note')->default('')->comment('用户备注');
            $table->string('pay_time')->default('')->comment('支付时间');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('orders');
    }
}
